import json


class Config:
    def __init__(self):
        pass

    def get_all_config(self):
        with open("config.json") as f:
            f_ = f.read()
            return json.loads(f_)

    def get_config(self, key):
        with open("config.json") as f:
            return json.load(f)[key]

    def set_config(self, key, value):
        all_conf = self.get_all_config()
        all_conf[key] = value
        with open("config.json", "w") as f:
            f.write(json.dumps(all_conf))


config = Config()
